/*
 * Copyright (C), 2017, 上海云首信息科技有限公司
 *
 * Author: 邓哲航
 * Date: 2018/5/17 上午11:47
 * History:
 * <author>    <time>    <version>    <desc>
 *
 */
package com.leaptocloud.easycloud.demo.service.impl;

import com.leaptocloud.easycloud.demo.dao.UserDao;
import com.leaptocloud.easycloud.demo.service.UserService;
import com.leaptocloud.easycloud.demo.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 邓哲航
 * @see
 * @since 2.3.8
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    @Transactional
    public void addUsers(String login) {
        User u = new User();

        for (int i = 0; i < 10; i++) {
            u.setId(Long.valueOf(i));
            u.setLogin("dzh" + i);
            userDao.addUser(u);

            if(i==9){
                String p=null;
                p.toCharArray();
            }
        }
    }
}
